<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="jquery-1.12.4.js"></script>
</head>

<body>
    <div id="dv">
        <p>第一个p</p>
        <p>第二个p</p>
    </div>
</body>
<script>
    // $('p:eq(1)').css('background','red')
    // $('p:nth-child(2)').css('background','red')
    // $('p:last').css('background', 'red')
    // $('p:last-child').css('background', 'red')
    $('#dv ').css('background', 'red')
</script>

</html>